cmake_minimum_required(VERSION 3.0.0)
project(thread_pool VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_VERBOSE_MAKEFILE ON)

set(CMAKE_CXX_FLAGS
    "-Werror -Wunused-variable -Wreorder-ctor -Wsign-compare -Wenum-compare -Wpessimizing-move -Wunused-private-field -Wdelete-non-abstract-non-virtual-dtor -fno-omit-frame-pointer -fsanitize=address -fexceptions"
)
set(CMAKE_C_FLAGS
    "-Werror -Wreorder-ctor -fno-omit-frame-pointer -fsanitize=address")
set(CMAKE_LINKER_FLAG
    "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")

add_executable(
  iam_utils_main_test
  test/user_auth_new/mocks/mock_iuser_auth_interface.cpp
  test/user_auth_new/src/context_factory_test.cpp
  test/user_auth_new/src/state_machine_test.cpp
  test/user_auth_new/src/resource_node_test.cpp
  test/user_auth_new/src/resource_node_pool_test.cpp
  test/user_auth_new/src/schedule_node_test.cpp
  test/user_auth_new/src/user_idm_database_test.cpp
  test/user_auth_new/src/context_pool_test.cpp
  test/user_auth_new/src/credential_info_test.cpp
  test/user_auth_new/src/relative_timer_test.cpp
  test/user_auth_new/src/enrolled_info_test.cpp
  test/user_auth_new/src/enrollment_impl_test.cpp
  test/user_auth_new/src/authentication_impl_test.cpp
  test/user_auth_new/src/attributes_test.cpp
  test/user_auth_new/src/user_auth_stub_test.cpp
  test/user_auth_new/src/secure_user_info_test.cpp
  test/user_auth_new/src/identification_impl_test.cpp
  test/user_auth_new/src/user_idm_stub_test.cpp
  test/user_auth_new/src/context_callback_impl_test.cpp
  test/user_auth_new/src/user_idm_session_controller_test.cpp
  test/user_auth_new/src/user_idm_service_test.cpp
  test/user_auth_new/src/enroll_context_test.cpp
  test/user_auth_new/src/identify_context_test.cpp
  test/user_auth_new/src/simple_auth_context_test.cpp
  )

target_include_directories(
  iam_utils_main_test
  PUBLIC service_new/core/inc
         service_new/context/inc
         service_new/context/src
         service_new/core/src
         service_new/core/src/actions
         service_new/ipc/inc
         service_new/dfx/inc
         service_new/common_defines/ipc
         test/user_auth_new/inc
         test/user_auth_new/mocks
)

find_package(OpenSSL REQUIRED)
target_link_libraries(iam_utils_main_test PUBLIC OpenSSL::SSL)

target_link_libraries(iam_utils_main_test PUBLIC ohos_hilog)
target_link_libraries(iam_utils_main_test PUBLIC ohos_utils)
target_link_libraries(iam_utils_main_test PUBLIC iam_utils)
target_link_libraries(iam_utils_main_test PUBLIC auth_widget)
target_link_libraries(iam_utils_main_test PUBLIC service_new)
target_link_libraries(iam_utils_main_test PUBLIC ipc)
target_link_libraries(iam_utils_main_test PUBLIC safwk)
target_link_libraries(iam_utils_main_test PUBLIC gmock)
target_link_libraries(iam_utils_main_test PUBLIC gtest_main)

add_subdirectory(ohos_hilog)
add_subdirectory(ohos_utils)
add_subdirectory(iam_utils)
add_subdirectory(auth_widget)
add_subdirectory(service_new)
add_subdirectory(ipc)
add_subdirectory(driver_interface)
add_subdirectory(safwk)
add_subdirectory(access_token)

add_subdirectory(extern/googletest)

enable_testing()
add_test(NAME iam_utils_main_test COMMAND iam_utils_main_test)
